<form id="couponaddfm" method="post">
<table border="0" width="100%" cellspacing="1" cellpadding="5" bgcolor="#c4d3e1" style="text-align:left; line-height:18px;">
		<tr bgcolor="#FFFFFF"> 
			<td style="line-height:30px;"  width="20%">标题：</td>
			<td width="80%"><input name="name" type="text" style="width:400px;" class="textbox-text validatebox-text textbox-prompt easyui-validatebox" placeholder="请输入标题.."  required="true"></td>
		</tr>
		<tr bgcolor="#FFFFFF"> 
			<td style="line-height:30px;"  width="20%">金额：</td>
			<td width="80%"><input name="value" type="number" class="textbox-text validatebox-text textbox-prompt easyui-validatebox" value="0.00" placeholder="请输入排序.."></td>
		</tr>
		<tr bgcolor="#FFFFFF"> 
			<td style="line-height:30px;"  width="20%">最低订单可用金额：</td>
			<td width="80%"><input name="min_amount" type="number" class="textbox-text validatebox-text textbox-prompt easyui-validatebox" value="0.00" placeholder="请输入排序.."></td>
		</tr>
		<tr bgcolor="#FFFFFF"> 
			<td style="line-height:30px;"  width="20%">剩余可领取次数：</td>
			<td width="80%"><input name="rest" type="number"  value="0"  class="textbox-text validatebox-text textbox-prompt easyui-validatebox"></td>
		</tr>
		<tr bgcolor="#FFFFFF">
			<td style="line-height:30px;"  width="20%">单个会员可领取次数：</td>
			<td width="80%"><input name="max_num" type="tel"  value="0"  class="textbox-text validatebox-text textbox-prompt easyui-validatebox">(0为不限领取次数)</td>
		</tr>
		<tr bgcolor="#FFFFFF"> 
			<td style="line-height:30px;"  width="20%">排序：</td>
			<td width="80%"><input name="sortorder" type="number"  value="500"  class="textbox-text validatebox-text textbox-prompt easyui-validatebox"></td>
		</tr>
		<tr bgcolor="#FFFFFF"> 
			<td style="line-height:30px;"  width="20%">开始日期：</td>
			<td width="80%"><input name="start_on" style="width:200px;"  type="text" class="textbox-text validatebox-text textbox-prompt easyui-validatebox easyui-datetimebox"></td>
		</tr>
		<tr bgcolor="#FFFFFF"> 
			<td style="line-height:30px;"  width="20%">结束日期：</td>
			<td width="80%"><input name="end_on" style="width:200px;"  type="text" class="textbox-text validatebox-text textbox-prompt easyui-validatebox easyui-datetimebox"></td>
		</tr>		
</table>
</form>

<script>
$(function(){
		$('#couponaddsubmit').click(function(data){			
				$('#couponaddfm').form('submit', {    
					url:'/admin/coupon/increase',    
					success: function(data){    
						var data = eval('(' + data + ')');
						
						if(data.ret==0){
								$.messager.show({
										title:'提示',
										msg:data.msg,
										timeout:3000,
										showType:'slide'
								});				
								$('#couponaddfm').form('clear');
								$("#coupondlg").dialog('close');
								$("#coupon").datagrid('reload');
						}else{
								$.messager.alert('提示',data.msg,'warning');
						}
					}    
				});
		})	
});
</script>
